package com.yanqu.road.web.controller.usercenter;

import com.yanqu.road.entity.web.HttpGameWebParam;
import com.yanqu.road.web.controller.BaseGameHttpServlet;
import com.yanqu.road.web.controller.usercenter.logic.ServerListHelper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/ServerListVN2")
public class PackageServerListVN2 extends BaseGameHttpServlet {

    private static Logger logger = LogManager.getLogger(PackageServerListVN2.class.getName());

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        HttpGameWebParam httpGameWebParam = super.parseRequest(request);
        sendMessage(response, ServerListHelper.getPackageServerListVN2(request, httpGameWebParam, false).toJSONString());
    }
}
